<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div:nth-child(1) {
            width: 200px;
            height: 200px;
            background-color: pink;
            /* transform: translate(x,y); */
            /* x就是往x轴移动的位置，y就是往y轴移动的位置 */
            transform: translate(100px, 100px);
            /* 只移动x轴的时候 */
            /* transform: translateX(100px); */
        }
        
        div:nth-child(1):hover {
            transform: translateX(-5px);
        }
        
        div:nth-child(2) {
            width: 300px;
            height: 300px;
            background-color: #ccc;
        }
    </style>
</head>

<body>
    <div></div>
    <div></div>
</body>

</html>